.class public final Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;
.super Landroid/content/ContentProvider;
.source "DownloadProvider.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$ReadOnlyCursorWrapper;,
        Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$DatabaseHelper;,
        Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;
    }
.end annotation


# static fields
.field private static final ALL_DOWNLOADS:I = 0x3

.field private static final ALL_DOWNLOADS_ID:I = 0x4

.field private static BASE_URIS:[Landroid/net/Uri; = null

.field private static final DB_NAME:Ljava/lang/String; = "downloads.db"

.field private static final DB_TABLE:Ljava/lang/String; = "downloads"

.field private static final DB_VERSION:I = 0x6b

.field private static final DOWNLOAD_LIST_TYPE:Ljava/lang/String; = "vnd.android.cursor.dir/download"

.field private static final DOWNLOAD_TYPE:Ljava/lang/String; = "vnd.android.cursor.item/download"

.field private static final MY_DOWNLOADS:I = 0x1

.field private static final MY_DOWNLOADS_ID:I = 0x2

.field private static final REQUEST_HEADERS_URI:I = 0x5

.field private static final sAppReadableColumnsArray:[Ljava/lang/String;

.field private static sAppReadableColumnsSet:Ljava/util/HashSet;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashSet",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private static sURIMatcher:Landroid/content/UriMatcher;


# instance fields
.field private mOpenHelper:Landroid/database/sqlite/SQLiteOpenHelper;

.field mSystemFacade:Lcom/zuimeia/sdk/download/providers/downloads/SystemFacade;


# direct methods
.method static constructor <clinit>()V
    .registers 4

    .prologue
    .line 77
    new-instance v1, Landroid/content/UriMatcher;

    const/4 v2, -0x1

    invoke-direct {v1, v2}, Landroid/content/UriMatcher;-><init>(I)V

    sput-object v1, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    .line 107
    const/4 v1, 0x0

    sput-object v1, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->BASE_URIS:[Landroid/net/Uri;

    .line 123
    const/16 v1, 0x18

    new-array v1, v1, [Ljava/lang/String;

    const/4 v2, 0x0

    const-string v3, "_id"

    aput-object v3, v1, v2

    const/4 v2, 0x1

    const-string v3, "entity"

    aput-object v3, v1, v2

    const/4 v2, 0x2

    const-string v3, "_data"

    aput-object v3, v1, v2

    const/4 v2, 0x3

    const-string v3, "mimetype"

    aput-object v3, v1, v2

    const/4 v2, 0x4

    const-string v3, "visibility"

    aput-object v3, v1, v2

    const/4 v2, 0x5

    const-string v3, "destination"

    aput-object v3, v1, v2

    const/4 v2, 0x6

    const-string v3, "control"

    aput-object v3, v1, v2

    const/4 v2, 0x7

    const-string v3, "status"

    aput-object v3, v1, v2

    const/16 v2, 0x8

    const-string v3, "lastmod"

    aput-object v3, v1, v2

    const/16 v2, 0x9

    const-string v3, "notificationpackage"

    aput-object v3, v1, v2

    const/16 v2, 0xa

    const-string v3, "notificationclass"

    aput-object v3, v1, v2

    const/16 v2, 0xb

    const-string v3, "total_bytes"

    aput-object v3, v1, v2

    const/16 v2, 0xc

    const-string v3, "current_bytes"

    aput-object v3, v1, v2

    const/16 v2, 0xd

    const-string v3, "title"

    aput-object v3, v1, v2

    const/16 v2, 0xe

    const-string v3, "description"

    aput-object v3, v1, v2

    const/16 v2, 0xf

    const-string v3, "uri"

    aput-object v3, v1, v2

    const/16 v2, 0x10

    const-string v3, "primary_key"

    aput-object v3, v1, v2

    const/16 v2, 0x11

    const-string v3, "apk_package_name"

    aput-object v3, v1, v2

    const/16 v2, 0x12

    const-string v3, "download_url"

    aput-object v3, v1, v2

    const/16 v2, 0x13

    const-string v3, "other_key"

    aput-object v3, v1, v2

    const/16 v2, 0x14

    const-string v3, "is_need_post_data"

    aput-object v3, v1, v2

    const/16 v2, 0x15

    const-string v3, "is_visible_in_downloads_ui"

    aput-object v3, v1, v2

    const/16 v2, 0x16

    const-string v3, "hint"

    aput-object v3, v1, v2

    const/16 v2, 0x17

    const-string v3, "deleted"

    aput-object v3, v1, v2

    sput-object v1, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sAppReadableColumnsArray:[Ljava/lang/String;

    .line 142
    new-instance v1, Ljava/util/HashSet;

    invoke-direct {v1}, Ljava/util/HashSet;-><init>()V

    sput-object v1, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sAppReadableColumnsSet:Ljava/util/HashSet;

    .line 143
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_a1
    sget-object v1, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sAppReadableColumnsArray:[Ljava/lang/String;

    array-length v1, v1

    if-ge v0, v1, :cond_b2

    .line 144
    sget-object v1, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sAppReadableColumnsSet:Ljava/util/HashSet;

    sget-object v2, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sAppReadableColumnsArray:[Ljava/lang/String;

    aget-object v2, v2, v0

    invoke-virtual {v1, v2}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    .line 143
    add-int/lit8 v0, v0, 0x1

    goto :goto_a1

    .line 146
    :cond_b2
    return-void
.end method

.method public constructor <init>()V
    .registers 2

    .prologue
    .line 51
    invoke-direct {p0}, Landroid/content/ContentProvider;-><init>()V

    .line 151
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->mOpenHelper:Landroid/database/sqlite/SQLiteOpenHelper;

    .line 1184
    return-void
.end method

.method private checkFileUriDestination(Landroid/content/ContentValues;)V
    .registers 10
    .param p1, "values"    # Landroid/content/ContentValues;

    .prologue
    .line 614
    const-string v5, "hint"

    invoke-virtual {p1, v5}, Landroid/content/ContentValues;->getAsString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 615
    .local v1, "fileUri":Ljava/lang/String;
    if-nez v1, :cond_10

    .line 616
    new-instance v5, Ljava/lang/IllegalArgumentException;

    const-string v6, "DESTINATION_FILE_URI must include a file URI under COLUMN_FILE_NAME_HINT"

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 619
    :cond_10
    invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v4

    .line 620
    .local v4, "uri":Landroid/net/Uri;
    invoke-virtual {v4}, Landroid/net/Uri;->getScheme()Ljava/lang/String;

    move-result-object v3

    .line 621
    .local v3, "scheme":Ljava/lang/String;
    if-eqz v3, :cond_22

    const-string v5, "file"

    invoke-virtual {v3, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-nez v5, :cond_3b

    .line 622
    :cond_22
    new-instance v5, Ljava/lang/IllegalArgumentException;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "Not a file URI: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 624
    :cond_3b
    invoke-virtual {v4}, Landroid/net/Uri;->getPath()Ljava/lang/String;

    move-result-object v2

    .line 625
    .local v2, "path":Ljava/lang/String;
    if-nez v2, :cond_5a

    .line 626
    new-instance v5, Ljava/lang/IllegalArgumentException;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "Invalid file URI: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 628
    :cond_5a
    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v5

    .line 629
    invoke-virtual {v5}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    .line 630
    .local v0, "externalPath":Ljava/lang/String;
    invoke-virtual {v2, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v5

    if-nez v5, :cond_81

    .line 631
    new-instance v5, Ljava/lang/SecurityException;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "Destination must be on external storage: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 634
    :cond_81
    return-void
.end method

.method private checkInsertPermissions(Landroid/content/ContentValues;)V
    .registers 14
    .param p1, "values"    # Landroid/content/ContentValues;

    .prologue
    const/4 v11, 0x2

    const/4 v10, 0x1

    const/4 v9, 0x0

    .line 646
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v6

    .line 647
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v7

    invoke-static {v7}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getPremissionAccess(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v7

    .line 646
    invoke-virtual {v6, v7}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I

    move-result v6

    if-nez v6, :cond_16

    .line 716
    :goto_15
    return-void

    .line 651
    :cond_16
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v6

    const-string v7, "android.permission.INTERNET"

    const-string v8, "INTERNET permission is required to use the download manager"

    invoke-virtual {v6, v7, v8}, Landroid/content/Context;->enforceCallingOrSelfPermission(Ljava/lang/String;Ljava/lang/String;)V

    .line 657
    new-instance v5, Landroid/content/ContentValues;

    invoke-direct {v5, p1}, Landroid/content/ContentValues;-><init>(Landroid/content/ContentValues;)V

    .line 660
    .end local p1    # "values":Landroid/content/ContentValues;
    .local v5, "values":Landroid/content/ContentValues;
    const-string v6, "is_public_api"

    new-array v7, v10, [Ljava/lang/Object;

    sget-object v8, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;

    aput-object v8, v7, v9

    invoke-direct {p0, v5, v6, v7}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->enforceAllowedValues(Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 662
    const-string v6, "destination"

    new-array v7, v10, [Ljava/lang/Object;

    const/4 v8, 0x4

    .line 663
    invoke-static {v8}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v8

    aput-object v8, v7, v9

    .line 662
    invoke-direct {p0, v5, v6, v7}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->enforceAllowedValues(Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 665
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v6

    .line 666
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v7

    invoke-static {v7}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getPremissionNoNotification(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v7

    .line 665
    invoke-virtual {v6, v7}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I

    move-result v6

    if-nez v6, :cond_da

    .line 667
    const-string v6, "visibility"

    new-array v7, v11, [Ljava/lang/Object;

    .line 668
    invoke-static {v11}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v8

    aput-object v8, v7, v9

    invoke-static {v9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v8

    aput-object v8, v7, v10

    .line 667
    invoke-direct {p0, v5, v6, v7}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->enforceAllowedValues(Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/Object;)V

    .line 675
    :goto_64
    const-string v6, "uri"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 676
    const-string v6, "primary_key"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 677
    const-string v6, "download_url"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 678
    const-string v6, "other_key"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 679
    const-string v6, "apk_package_name"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 680
    const-string v6, "is_need_post_data"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 681
    const-string v6, "title"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 682
    const-string v6, "description"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 683
    const-string v6, "mimetype"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 684
    const-string v6, "hint"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 686
    const-string v6, "notificationpackage"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 689
    const-string v6, "allowed_network_types"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 690
    const-string v6, "allow_roaming"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 691
    const-string v6, "is_visible_in_downloads_ui"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 692
    const-string v6, "notificationclass"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 693
    const-string v6, "notificationextras"

    invoke-virtual {v5, v6}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 694
    invoke-virtual {v5}, Landroid/content/ContentValues;->valueSet()Ljava/util/Set;

    move-result-object v6

    .line 695
    invoke-interface {v6}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v3

    .line 696
    .local v3, "iterator":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/Object;>;>;"
    :cond_bc
    :goto_bc
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v6

    if-eqz v6, :cond_e9

    .line 697
    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/util/Map$Entry;

    invoke-interface {v6}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    .line 698
    .local v4, "key":Ljava/lang/String;
    const-string v6, "http_header_"

    invoke-virtual {v4, v6}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_bc

    .line 699
    invoke-interface {v3}, Ljava/util/Iterator;->remove()V

    goto :goto_bc

    .line 670
    .end local v3    # "iterator":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .end local v4    # "key":Ljava/lang/String;
    :cond_da
    const-string v6, "visibility"

    new-array v7, v10, [Ljava/lang/Object;

    .line 671
    invoke-static {v9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v8

    aput-object v8, v7, v9

    .line 670
    invoke-direct {p0, v5, v6, v7}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->enforceAllowedValues(Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/Object;)V

    goto/16 :goto_64

    .line 704
    .restart local v3    # "iterator":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/Object;>;>;"
    :cond_e9
    invoke-virtual {v5}, Landroid/content/ContentValues;->size()I

    move-result v6

    if-lez v6, :cond_126

    .line 705
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v6, "Invalid columns in request: "

    invoke-direct {v1, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 707
    .local v1, "error":Ljava/lang/StringBuilder;
    const/4 v2, 0x1

    .line 708
    .local v2, "first":Z
    invoke-virtual {v5}, Landroid/content/ContentValues;->valueSet()Ljava/util/Set;

    move-result-object v6

    invoke-interface {v6}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v7

    :goto_ff
    invoke-interface {v7}, Ljava/util/Iterator;->hasNext()Z

    move-result v6

    if-eqz v6, :cond_11c

    invoke-interface {v7}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 709
    .local v0, "entry":Ljava/util/Map$Entry;, "Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/Object;>;"
    if-nez v2, :cond_112

    .line 710
    const-string v6, ", "

    invoke-virtual {v1, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 712
    :cond_112
    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/String;

    invoke-virtual {v1, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_ff

    .line 714
    .end local v0    # "entry":Ljava/util/Map$Entry;, "Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/Object;>;"
    :cond_11c
    new-instance v6, Ljava/lang/SecurityException;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V

    throw v6

    .end local v1    # "error":Ljava/lang/StringBuilder;
    .end local v2    # "first":Z
    :cond_126
    move-object p1, v5

    .line 716
    .end local v5    # "values":Landroid/content/ContentValues;
    .restart local p1    # "values":Landroid/content/ContentValues;
    goto/16 :goto_15
.end method

.method private static final copyBoolean(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V
    .registers 4
    .param p0, "key"    # Ljava/lang/String;
    .param p1, "from"    # Landroid/content/ContentValues;
    .param p2, "to"    # Landroid/content/ContentValues;

    .prologue
    .line 1162
    invoke-virtual {p1, p0}, Landroid/content/ContentValues;->getAsBoolean(Ljava/lang/String;)Ljava/lang/Boolean;

    move-result-object v0

    .line 1163
    .local v0, "b":Ljava/lang/Boolean;
    if-eqz v0, :cond_9

    .line 1164
    invoke-virtual {p2, p0, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Boolean;)V

    .line 1166
    :cond_9
    return-void
.end method

.method private static final copyInteger(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V
    .registers 4
    .param p0, "key"    # Ljava/lang/String;
    .param p1, "from"    # Landroid/content/ContentValues;
    .param p2, "to"    # Landroid/content/ContentValues;

    .prologue
    .line 1154
    invoke-virtual {p1, p0}, Landroid/content/ContentValues;->getAsInteger(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v0

    .line 1155
    .local v0, "i":Ljava/lang/Integer;
    if-eqz v0, :cond_9

    .line 1156
    invoke-virtual {p2, p0, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 1158
    :cond_9
    return-void
.end method

.method private static final copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V
    .registers 4
    .param p0, "key"    # Ljava/lang/String;
    .param p1, "from"    # Landroid/content/ContentValues;
    .param p2, "to"    # Landroid/content/ContentValues;

    .prologue
    .line 1170
    invoke-virtual {p1, p0}, Landroid/content/ContentValues;->getAsString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 1171
    .local v0, "s":Ljava/lang/String;
    if-eqz v0, :cond_9

    .line 1172
    invoke-virtual {p2, p0, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 1174
    :cond_9
    return-void
.end method

.method private static final copyStringWithDefault(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;Ljava/lang/String;)V
    .registers 5
    .param p0, "key"    # Ljava/lang/String;
    .param p1, "from"    # Landroid/content/ContentValues;
    .param p2, "to"    # Landroid/content/ContentValues;
    .param p3, "defaultValue"    # Ljava/lang/String;

    .prologue
    .line 1178
    invoke-static {p0, p1, p2}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 1179
    invoke-virtual {p2, p0}, Landroid/content/ContentValues;->containsKey(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_c

    .line 1180
    invoke-virtual {p2, p0, p3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 1182
    :cond_c
    return-void
.end method

.method private deleteRequestHeaders(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;[Ljava/lang/String;)V
    .registers 17
    .param p1, "db"    # Landroid/database/sqlite/SQLiteDatabase;
    .param p2, "where"    # Ljava/lang/String;
    .param p3, "whereArgs"    # [Ljava/lang/String;

    .prologue
    .line 888
    const/4 v0, 0x1

    new-array v2, v0, [Ljava/lang/String;

    const/4 v0, 0x0

    const-string v1, "_id"

    aput-object v1, v2, v0

    .line 889
    .local v2, "projection":[Ljava/lang/String;
    const-string v1, "downloads"

    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    const/4 v8, 0x0

    move-object v0, p1

    move-object v3, p2

    move-object/from16 v4, p3

    invoke-virtual/range {v0 .. v8}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v9

    .line 892
    .local v9, "cursor":Landroid/database/Cursor;
    :try_start_16
    invoke-interface {v9}, Landroid/database/Cursor;->moveToFirst()Z

    :goto_19
    invoke-interface {v9}, Landroid/database/Cursor;->isAfterLast()Z

    move-result v0

    if-nez v0, :cond_46

    .line 894
    const/4 v0, 0x0

    invoke-interface {v9, v0}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v10

    .line 895
    .local v10, "id":J
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "download_id="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, v10, v11}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    .line 897
    .local v12, "idWhere":Ljava/lang/String;
    const-string v0, "request_headers"

    const/4 v1, 0x0

    invoke-virtual {p1, v0, v12, v1}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I

    .line 893
    invoke-interface {v9}, Landroid/database/Cursor;->moveToNext()Z
    :try_end_40
    .catchall {:try_start_16 .. :try_end_40} :catchall_41

    goto :goto_19

    .line 901
    .end local v10    # "id":J
    .end local v12    # "idWhere":Ljava/lang/String;
    :catchall_41
    move-exception v0

    invoke-interface {v9}, Landroid/database/Cursor;->close()V

    throw v0

    :cond_46
    invoke-interface {v9}, Landroid/database/Cursor;->close()V

    .line 903
    return-void
.end method

.method private varargs enforceAllowedValues(Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/Object;)V
    .registers 9
    .param p1, "values"    # Landroid/content/ContentValues;
    .param p2, "column"    # Ljava/lang/String;
    .param p3, "allowedValues"    # [Ljava/lang/Object;

    .prologue
    .line 724
    invoke-virtual {p1, p2}, Landroid/content/ContentValues;->get(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    .line 725
    .local v1, "value":Ljava/lang/Object;
    invoke-virtual {p1, p2}, Landroid/content/ContentValues;->remove(Ljava/lang/String;)V

    .line 726
    array-length v3, p3

    const/4 v2, 0x0

    :goto_9
    if-ge v2, v3, :cond_1d

    aget-object v0, p3, v2

    .line 727
    .local v0, "allowedValue":Ljava/lang/Object;
    if-nez v1, :cond_12

    if-nez v0, :cond_12

    .line 731
    :cond_11
    return-void

    .line 730
    :cond_12
    if-eqz v1, :cond_1a

    invoke-virtual {v1, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-nez v4, :cond_11

    .line 726
    :cond_1a
    add-int/lit8 v2, v2, 0x1

    goto :goto_9

    .line 734
    .end local v0    # "allowedValue":Ljava/lang/Object;
    :cond_1d
    new-instance v2, Ljava/lang/SecurityException;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Invalid value for "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ": "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V

    throw v2
.end method

.method private getDownloadIdFromUri(Landroid/net/Uri;)Ljava/lang/String;
    .registers 4
    .param p1, "uri"    # Landroid/net/Uri;

    .prologue
    .line 840
    invoke-virtual {p1}, Landroid/net/Uri;->getPathSegments()Ljava/util/List;

    move-result-object v0

    const/4 v1, 0x1

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    return-object v0
.end method

.method private getWhereClause(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;I)Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;
    .registers 12
    .param p1, "uri"    # Landroid/net/Uri;
    .param p2, "where"    # Ljava/lang/String;
    .param p3, "whereArgs"    # [Ljava/lang/String;
    .param p4, "uriMatch"    # I

    .prologue
    const/4 v6, 0x0

    const/4 v5, 0x2

    const/4 v4, 0x1

    .line 1015
    new-instance v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;-><init>(Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$1;)V

    .line 1016
    .local v0, "selection":Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;
    invoke-virtual {v0, p2, p3}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;->appendClause(Ljava/lang/String;[Ljava/lang/Object;)V

    .line 1017
    if-eq p4, v5, :cond_11

    const/4 v1, 0x4

    if-ne p4, v1, :cond_1e

    .line 1018
    :cond_11
    const-string v1, "_id = ?"

    new-array v2, v4, [Ljava/lang/String;

    .line 1019
    invoke-direct {p0, p1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getDownloadIdFromUri(Landroid/net/Uri;)Ljava/lang/String;

    move-result-object v3

    aput-object v3, v2, v6

    .line 1018
    invoke-virtual {v0, v1, v2}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;->appendClause(Ljava/lang/String;[Ljava/lang/Object;)V

    .line 1021
    :cond_1e
    if-eq p4, v4, :cond_22

    if-ne p4, v5, :cond_4f

    .line 1022
    :cond_22
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v1

    .line 1023
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getPremissionAccessAll(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v2

    .line 1022
    invoke-virtual {v1, v2}, Landroid/content/Context;->checkCallingPermission(Ljava/lang/String;)I

    move-result v1

    if-eqz v1, :cond_4f

    .line 1024
    const-string v1, "uid= ? OR otheruid= ?"

    new-array v2, v5, [Ljava/lang/Integer;

    .line 1026
    invoke-static {}, Landroid/os/Binder;->getCallingUid()I

    move-result v3

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v6

    invoke-static {}, Landroid/os/Binder;->getCallingPid()I

    move-result v3

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v4

    .line 1024
    invoke-virtual {v0, v1, v2}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;->appendClause(Ljava/lang/String;[Ljava/lang/Object;)V

    .line 1028
    :cond_4f
    return-object v0
.end method

.method private static initBaseURIs(Landroid/content/Context;)V
    .registers 8
    .param p0, "mContext"    # Landroid/content/Context;

    .prologue
    const/4 v6, 0x5

    const/4 v5, 0x2

    const/4 v4, 0x1

    .line 109
    new-instance v0, Landroid/content/UriMatcher;

    const/4 v1, -0x1

    invoke-direct {v0, v1}, Landroid/content/UriMatcher;-><init>(I)V

    sput-object v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    .line 110
    sget-object v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    invoke-static {p0}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getAuthority(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "my_downloads"

    invoke-virtual {v0, v1, v2, v4}, Landroid/content/UriMatcher;->addURI(Ljava/lang/String;Ljava/lang/String;I)V

    .line 111
    sget-object v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    invoke-static {p0}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getAuthority(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "my_downloads/#"

    invoke-virtual {v0, v1, v2, v5}, Landroid/content/UriMatcher;->addURI(Ljava/lang/String;Ljava/lang/String;I)V

    .line 113
    sget-object v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    invoke-static {p0}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getAuthority(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "all_downloads"

    const/4 v3, 0x3

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/UriMatcher;->addURI(Ljava/lang/String;Ljava/lang/String;I)V

    .line 114
    sget-object v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    invoke-static {p0}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getAuthority(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "all_downloads/#"

    const/4 v3, 0x4

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/UriMatcher;->addURI(Ljava/lang/String;Ljava/lang/String;I)V

    .line 116
    sget-object v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    invoke-static {p0}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getAuthority(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "my_downloads/#/headers"

    invoke-virtual {v0, v1, v2, v6}, Landroid/content/UriMatcher;->addURI(Ljava/lang/String;Ljava/lang/String;I)V

    .line 118
    sget-object v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    invoke-static {p0}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getAuthority(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "all_downloads/#/headers"

    invoke-virtual {v0, v1, v2, v6}, Landroid/content/UriMatcher;->addURI(Ljava/lang/String;Ljava/lang/String;I)V

    .line 120
    new-array v0, v5, [Landroid/net/Uri;

    const/4 v1, 0x0

    invoke-static {p0}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getContentURI(Landroid/content/Context;)Landroid/net/Uri;

    move-result-object v2

    aput-object v2, v0, v1

    .line 121
    invoke-static {p0}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getAllDownloadsContentURI(Landroid/content/Context;)Landroid/net/Uri;

    move-result-object v1

    aput-object v1, v0, v4

    sput-object v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->BASE_URIS:[Landroid/net/Uri;

    .line 122
    return-void
.end method

.method private insertRequestHeaders(Landroid/database/sqlite/SQLiteDatabase;JLandroid/content/ContentValues;)V
    .registers 13
    .param p1, "db"    # Landroid/database/sqlite/SQLiteDatabase;
    .param p2, "downloadId"    # J
    .param p4, "values"    # Landroid/content/ContentValues;

    .prologue
    .line 848
    new-instance v4, Landroid/content/ContentValues;

    invoke-direct {v4}, Landroid/content/ContentValues;-><init>()V

    .line 849
    .local v4, "rowValues":Landroid/content/ContentValues;
    const-string v5, "download_id"

    invoke-static {p2, p3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v6

    invoke-virtual {v4, v5, v6}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    .line 850
    invoke-virtual {p4}, Landroid/content/ContentValues;->valueSet()Ljava/util/Set;

    move-result-object v5

    invoke-interface {v5}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v5

    :cond_16
    :goto_16
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v6

    if-eqz v6, :cond_7f

    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 851
    .local v0, "entry":Ljava/util/Map$Entry;, "Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/Object;>;"
    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 852
    .local v2, "key":Ljava/lang/String;
    const-string v6, "http_header_"

    invoke-virtual {v2, v6}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_16

    .line 853
    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    .line 854
    .local v1, "headerLine":Ljava/lang/String;
    const-string v6, ":"

    invoke-virtual {v1, v6}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v6

    if-nez v6, :cond_59

    .line 855
    new-instance v5, Ljava/lang/IllegalArgumentException;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "Invalid HTTP header line: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 858
    :cond_59
    const-string v6, ":"

    const/4 v7, 0x2

    invoke-virtual {v1, v6, v7}, Ljava/lang/String;->split(Ljava/lang/String;I)[Ljava/lang/String;

    move-result-object v3

    .line 859
    .local v3, "parts":[Ljava/lang/String;
    const-string v6, "header"

    const/4 v7, 0x0

    aget-object v7, v3, v7

    .line 860
    invoke-virtual {v7}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v7

    .line 859
    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 861
    const-string v6, "value"

    const/4 v7, 0x1

    aget-object v7, v3, v7

    .line 862
    invoke-virtual {v7}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v7

    .line 861
    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 863
    const-string v6, "request_headers"

    const/4 v7, 0x0

    invoke-virtual {p1, v6, v7, v4}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    goto :goto_16

    .line 867
    .end local v0    # "entry":Ljava/util/Map$Entry;, "Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/Object;>;"
    .end local v1    # "headerLine":Ljava/lang/String;
    .end local v2    # "key":Ljava/lang/String;
    .end local v3    # "parts":[Ljava/lang/String;
    :cond_7f
    return-void
.end method

.method private logVerboseOpenFileInfo(Landroid/net/Uri;Ljava/lang/String;)V
    .registers 13
    .param p1, "uri"    # Landroid/net/Uri;
    .param p2, "mode"    # Ljava/lang/String;

    .prologue
    const/4 v9, 0x1

    const/4 v8, 0x0

    const/4 v3, 0x0

    .line 1118
    const-string v0, "DownloadManager"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "openFile uri: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", mode: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", uid: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    .line 1119
    invoke-static {}, Landroid/os/Binder;->getCallingUid()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 1118
    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 1120
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getContentURI(Landroid/content/Context;)Landroid/net/Uri;

    move-result-object v1

    new-array v2, v9, [Ljava/lang/String;

    const-string v0, "_id"

    aput-object v0, v2, v8

    const-string v5, "_id"

    move-object v0, p0

    move-object v4, v3

    invoke-virtual/range {v0 .. v5}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 1122
    .local v6, "cursor":Landroid/database/Cursor;
    if-nez v6, :cond_6a

    .line 1123
    const-string v0, "DownloadManager"

    const-string v1, "null cursor in openFile"

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 1135
    :goto_52
    new-array v2, v9, [Ljava/lang/String;

    const-string v0, "_data"

    aput-object v0, v2, v8

    move-object v0, p0

    move-object v1, p1

    move-object v4, v3

    move-object v5, v3

    invoke-virtual/range {v0 .. v5}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 1136
    if-nez v6, :cond_a4

    .line 1137
    const-string v0, "DownloadManager"

    const-string v1, "null cursor in openFile"

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 1150
    :goto_69
    return-void

    .line 1125
    :cond_6a
    invoke-interface {v6}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v0

    if-nez v0, :cond_7b

    .line 1126
    const-string v0, "DownloadManager"

    const-string v1, "empty cursor in openFile"

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 1133
    :goto_77
    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    goto :goto_52

    .line 1129
    :cond_7b
    const-string v0, "DownloadManager"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "row "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-interface {v6, v8}, Landroid/database/Cursor;->getInt(I)I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " available"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 1131
    invoke-interface {v6}, Landroid/database/Cursor;->moveToNext()Z

    move-result v0

    if-nez v0, :cond_7b

    goto :goto_77

    .line 1139
    :cond_a4
    invoke-interface {v6}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v0

    if-nez v0, :cond_b5

    .line 1140
    const-string v0, "DownloadManager"

    const-string v1, "empty cursor in openFile"

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 1148
    :cond_b1
    :goto_b1
    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    goto :goto_69

    .line 1142
    :cond_b5
    invoke-interface {v6, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v7

    .line 1143
    .local v7, "filename":Ljava/lang/String;
    const-string v0, "DownloadManager"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "filename in openFile: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 1144
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, v7}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/io/File;->isFile()Z

    move-result v0

    if-eqz v0, :cond_b1

    .line 1145
    const-string v0, "DownloadManager"

    const-string v1, "file exists in openFile"

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_b1
.end method

.method private logVerboseQueryInfo([Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Landroid/database/sqlite/SQLiteDatabase;)V
    .registers 10
    .param p1, "projection"    # [Ljava/lang/String;
    .param p2, "selection"    # Ljava/lang/String;
    .param p3, "selectionArgs"    # [Ljava/lang/String;
    .param p4, "sort"    # Ljava/lang/String;
    .param p5, "db"    # Landroid/database/sqlite/SQLiteDatabase;

    .prologue
    .line 798
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    .line 799
    .local v1, "sb":Ljava/lang/StringBuilder;
    const-string v2, "starting query, database is "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 800
    if-eqz p5, :cond_11

    .line 801
    const-string v2, "not "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 803
    :cond_11
    const-string v2, "null; "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 804
    if-nez p1, :cond_48

    .line 805
    const-string v2, "projection is null; "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 817
    :cond_1d
    :goto_1d
    const-string v2, "selection is "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 818
    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 819
    const-string v2, "; "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 820
    if-nez p3, :cond_6f

    .line 821
    const-string v2, "selectionArgs is null; "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 833
    :cond_31
    :goto_31
    const-string v2, "sort is "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 834
    invoke-virtual {v1, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 835
    const-string v2, "."

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 836
    const-string v2, "DownloadManager"

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 837
    return-void

    .line 806
    :cond_48
    array-length v2, p1

    if-nez v2, :cond_51

    .line 807
    const-string v2, "projection is empty; "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_1d

    .line 809
    :cond_51
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_52
    array-length v2, p1

    if-ge v0, v2, :cond_1d

    .line 810
    const-string v2, "projection["

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 811
    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    .line 812
    const-string v2, "] is "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 813
    aget-object v2, p1, v0

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 814
    const-string v2, "; "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 809
    add-int/lit8 v0, v0, 0x1

    goto :goto_52

    .line 822
    .end local v0    # "i":I
    :cond_6f
    array-length v2, p3

    if-nez v2, :cond_78

    .line 823
    const-string v2, "selectionArgs is empty; "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_31

    .line 825
    :cond_78
    const/4 v0, 0x0

    .restart local v0    # "i":I
    :goto_79
    array-length v2, p3

    if-ge v0, v2, :cond_31

    .line 826
    const-string v2, "selectionArgs["

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 827
    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    .line 828
    const-string v2, "] is "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 829
    aget-object v2, p3, v0

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 830
    const-string v2, "; "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 825
    add-int/lit8 v0, v0, 0x1

    goto :goto_79
.end method

.method private notifyContentChanged(Landroid/net/Uri;I)V
    .registers 11
    .param p1, "uri"    # Landroid/net/Uri;
    .param p2, "uriMatch"    # I

    .prologue
    .line 1000
    const/4 v0, 0x0

    .line 1001
    .local v0, "downloadId":Ljava/lang/Long;
    const/4 v2, 0x2

    if-eq p2, v2, :cond_7

    const/4 v2, 0x4

    if-ne p2, v2, :cond_13

    .line 1002
    :cond_7
    invoke-direct {p0, p1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getDownloadIdFromUri(Landroid/net/Uri;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    .line 1004
    :cond_13
    sget-object v3, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->BASE_URIS:[Landroid/net/Uri;

    array-length v4, v3

    const/4 v2, 0x0

    :goto_17
    if-ge v2, v4, :cond_34

    aget-object v1, v3, v2

    .line 1005
    .local v1, "uriToNotify":Landroid/net/Uri;
    if-eqz v0, :cond_25

    .line 1007
    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v6

    .line 1006
    invoke-static {v1, v6, v7}, Landroid/content/ContentUris;->withAppendedId(Landroid/net/Uri;J)Landroid/net/Uri;

    move-result-object v1

    .line 1009
    :cond_25
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const/4 v6, 0x0

    invoke-virtual {v5, v1, v6}, Landroid/content/ContentResolver;->notifyChange(Landroid/net/Uri;Landroid/database/ContentObserver;)V

    .line 1004
    add-int/lit8 v2, v2, 0x1

    goto :goto_17

    .line 1011
    .end local v1    # "uriToNotify":Landroid/net/Uri;
    :cond_34
    return-void
.end method

.method private queryRequestHeaders(Landroid/database/sqlite/SQLiteDatabase;Landroid/net/Uri;)Landroid/database/Cursor;
    .registers 12
    .param p1, "db"    # Landroid/database/sqlite/SQLiteDatabase;
    .param p2, "uri"    # Landroid/net/Uri;

    .prologue
    const/4 v4, 0x0

    .line 873
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "download_id="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 874
    invoke-direct {p0, p2}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getDownloadIdFromUri(Landroid/net/Uri;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    .line 875
    .local v3, "where":Ljava/lang/String;
    const/4 v0, 0x2

    new-array v2, v0, [Ljava/lang/String;

    const/4 v0, 0x0

    const-string v1, "header"

    aput-object v1, v2, v0

    const/4 v0, 0x1

    const-string v1, "value"

    aput-object v1, v2, v0

    .line 878
    .local v2, "projection":[Ljava/lang/String;
    const-string v1, "request_headers"

    move-object v0, p1

    move-object v5, v4

    move-object v6, v4

    move-object v7, v4

    invoke-virtual/range {v0 .. v7}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v8

    .line 880
    .local v8, "cursor":Landroid/database/Cursor;
    new-instance v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$ReadOnlyCursorWrapper;

    invoke-direct {v0, p0, v8}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$ReadOnlyCursorWrapper;-><init>(Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;Landroid/database/Cursor;)V

    return-object v0
.end method


# virtual methods
.method public delete(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I
    .registers 11
    .param p1, "uri"    # Landroid/net/Uri;
    .param p2, "where"    # Ljava/lang/String;
    .param p3, "whereArgs"    # [Ljava/lang/String;

    .prologue
    .line 1038
    sget-object v4, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sAppReadableColumnsSet:Ljava/util/HashSet;

    invoke-static {p2, v4}, Lcom/zuimeia/sdk/download/providers/downloads/Helpers;->validateSelection(Ljava/lang/String;Ljava/util/Set;)V

    .line 1040
    iget-object v4, p0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->mOpenHelper:Landroid/database/sqlite/SQLiteOpenHelper;

    invoke-virtual {v4}, Landroid/database/sqlite/SQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    .line 1042
    .local v1, "db":Landroid/database/sqlite/SQLiteDatabase;
    sget-object v4, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    invoke-virtual {v4, p1}, Landroid/content/UriMatcher;->match(Landroid/net/Uri;)I

    move-result v2

    .line 1043
    .local v2, "match":I
    packed-switch v2, :pswitch_data_66

    .line 1057
    const-string v4, "DownloadManager"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "deleting unknown/invalid URI: "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 1058
    new-instance v4, Ljava/lang/UnsupportedOperationException;

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "Cannot delete URI: "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v4

    .line 1048
    :pswitch_45
    invoke-direct {p0, p1, p2, p3, v2}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getWhereClause(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;I)Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;

    move-result-object v3

    .line 1050
    .local v3, "selection":Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;
    invoke-virtual {v3}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;->getSelection()Ljava/lang/String;

    move-result-object v4

    .line 1051
    invoke-virtual {v3}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;->getParameters()[Ljava/lang/String;

    move-result-object v5

    .line 1050
    invoke-direct {p0, v1, v4, v5}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->deleteRequestHeaders(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;[Ljava/lang/String;)V

    .line 1052
    const-string v4, "downloads"

    invoke-virtual {v3}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;->getSelection()Ljava/lang/String;

    move-result-object v5

    .line 1053
    invoke-virtual {v3}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;->getParameters()[Ljava/lang/String;

    move-result-object v6

    .line 1052
    invoke-virtual {v1, v4, v5, v6}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I

    move-result v0

    .line 1060
    .local v0, "count":I
    invoke-direct {p0, p1, v2}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->notifyContentChanged(Landroid/net/Uri;I)V

    .line 1061
    return v0

    .line 1043
    :pswitch_data_66
    .packed-switch 0x1
        :pswitch_45
        :pswitch_45
        :pswitch_45
        :pswitch_45
    .end packed-switch
.end method

.method public getType(Landroid/net/Uri;)Ljava/lang/String;
    .registers 6
    .param p1, "uri"    # Landroid/net/Uri;

    .prologue
    .line 445
    sget-object v1, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    invoke-virtual {v1, p1}, Landroid/content/UriMatcher;->match(Landroid/net/Uri;)I

    move-result v0

    .line 446
    .local v0, "match":I
    packed-switch v0, :pswitch_data_28

    .line 458
    new-instance v1, Ljava/lang/IllegalArgumentException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Unknown URI: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v1

    .line 448
    :pswitch_22
    const-string v1, "vnd.android.cursor.dir/download"

    .line 451
    :goto_24
    return-object v1

    :pswitch_25
    const-string v1, "vnd.android.cursor.item/download"

    goto :goto_24

    .line 446
    :pswitch_data_28
    .packed-switch 0x1
        :pswitch_22
        :pswitch_25
    .end packed-switch
.end method

.method public insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
    .registers 23
    .param p1, "uri"    # Landroid/net/Uri;
    .param p2, "values"    # Landroid/content/ContentValues;

    .prologue
    .line 468
    move-object/from16 v0, p0

    move-object/from16 v1, p2

    invoke-direct {v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->checkInsertPermissions(Landroid/content/ContentValues;)V

    .line 469
    move-object/from16 v0, p0

    iget-object v15, v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->mOpenHelper:Landroid/database/sqlite/SQLiteOpenHelper;

    invoke-virtual {v15}, Landroid/database/sqlite/SQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v4

    .line 472
    .local v4, "db":Landroid/database/sqlite/SQLiteDatabase;
    sget-object v15, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    move-object/from16 v0, p1

    invoke-virtual {v15, v0}, Landroid/content/UriMatcher;->match(Landroid/net/Uri;)I

    move-result v9

    .line 473
    .local v9, "match":I
    const/4 v15, 0x1

    if-eq v9, v15, :cond_53

    .line 474
    const-string v15, "DownloadManager"

    new-instance v16, Ljava/lang/StringBuilder;

    invoke-direct/range {v16 .. v16}, Ljava/lang/StringBuilder;-><init>()V

    const-string v17, "calling insert on an unknown/invalid URI: "

    invoke-virtual/range {v16 .. v17}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v16

    move-object/from16 v0, v16

    move-object/from16 v1, p1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v16

    invoke-virtual/range {v16 .. v16}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v16

    invoke-static/range {v15 .. v16}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 476
    new-instance v15, Ljava/lang/IllegalArgumentException;

    new-instance v16, Ljava/lang/StringBuilder;

    invoke-direct/range {v16 .. v16}, Ljava/lang/StringBuilder;-><init>()V

    const-string v17, "Unknown/Invalid URI "

    invoke-virtual/range {v16 .. v17}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v16

    move-object/from16 v0, v16

    move-object/from16 v1, p1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v16

    invoke-virtual/range {v16 .. v16}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v16

    invoke-direct/range {v15 .. v16}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v15

    .line 479
    :cond_53
    new-instance v6, Landroid/content/ContentValues;

    invoke-direct {v6}, Landroid/content/ContentValues;-><init>()V

    .line 481
    .local v6, "filteredValues":Landroid/content/ContentValues;
    const-string v15, "uri"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 482
    const-string v15, "primary_key"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 483
    const-string v15, "download_url"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 484
    const-string v15, "other_key"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 485
    const-string v15, "apk_package_name"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 486
    const-string v15, "is_need_post_data"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 487
    const-string v15, "entity"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 488
    const-string v15, "no_integrity"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyBoolean(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 489
    const-string v15, "hint"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 490
    const-string v15, "mimetype"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 492
    const-string v15, "is_public_api"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyBoolean(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 493
    const-string v15, "is_public_api"

    .line 494
    move-object/from16 v0, p2

    invoke-virtual {v0, v15}, Landroid/content/ContentValues;->getAsBoolean(Ljava/lang/String;)Ljava/lang/Boolean;

    move-result-object v15

    sget-object v16, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;

    move-object/from16 v0, v16

    if-ne v15, v0, :cond_e8

    const/4 v8, 0x1

    .line 496
    .local v8, "isPublicApi":Z
    :goto_b4
    const-string v15, "destination"

    move-object/from16 v0, p2

    invoke-virtual {v0, v15}, Landroid/content/ContentValues;->getAsInteger(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v5

    .line 497
    .local v5, "dest":Ljava/lang/Integer;
    if-eqz v5, :cond_113

    .line 498
    invoke-virtual/range {p0 .. p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v15

    .line 499
    invoke-virtual/range {p0 .. p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v16

    invoke-static/range {v16 .. v16}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getPremissionAccessAdvanced(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v16

    .line 498
    invoke-virtual/range {v15 .. v16}, Landroid/content/Context;->checkCallingPermission(Ljava/lang/String;)I

    move-result v15

    if-eqz v15, :cond_ea

    .line 500
    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v15

    if-eqz v15, :cond_ea

    .line 501
    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v15

    const/16 v16, 0x4

    move/from16 v0, v16

    if-eq v15, v0, :cond_ea

    .line 502
    new-instance v15, Ljava/lang/SecurityException;

    const-string v16, "unauthorized destination code"

    invoke-direct/range {v15 .. v16}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V

    throw v15

    .line 494
    .end local v5    # "dest":Ljava/lang/Integer;
    .end local v8    # "isPublicApi":Z
    :cond_e8
    const/4 v8, 0x0

    goto :goto_b4

    .line 504
    .restart local v5    # "dest":Ljava/lang/Integer;
    .restart local v8    # "isPublicApi":Z
    :cond_ea
    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v15

    const/16 v16, 0x4

    move/from16 v0, v16

    if-ne v15, v0, :cond_10e

    .line 505
    invoke-virtual/range {p0 .. p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v15

    const-string v16, "android.permission.WRITE_EXTERNAL_STORAGE"

    .line 508
    invoke-static {}, Landroid/os/Binder;->getCallingPid()I

    move-result v17

    invoke-static {}, Landroid/os/Binder;->getCallingUid()I

    move-result v18

    const-string v19, "need WRITE_EXTERNAL_STORAGE permission to use DESTINATION_FILE_URI"

    .line 506
    invoke-virtual/range {v15 .. v19}, Landroid/content/Context;->enforcePermission(Ljava/lang/String;IILjava/lang/String;)V

    .line 510
    move-object/from16 v0, p0

    move-object/from16 v1, p2

    invoke-direct {v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->checkFileUriDestination(Landroid/content/ContentValues;)V

    .line 512
    :cond_10e
    const-string v15, "destination"

    invoke-virtual {v6, v15, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 514
    :cond_113
    const-string v15, "visibility"

    move-object/from16 v0, p2

    invoke-virtual {v0, v15}, Landroid/content/ContentValues;->getAsInteger(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v14

    .line 515
    .local v14, "vis":Ljava/lang/Integer;
    if-nez v14, :cond_26c

    .line 516
    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v15

    if-nez v15, :cond_25d

    .line 517
    const-string v15, "visibility"

    const/16 v16, 0x1

    .line 518
    invoke-static/range {v16 .. v16}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v16

    .line 517
    move-object/from16 v0, v16

    invoke-virtual {v6, v15, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 526
    :goto_130
    const-string v15, "control"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyInteger(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 527
    const-string v15, "status"

    const/16 v16, 0xbe

    invoke-static/range {v16 .. v16}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v16

    move-object/from16 v0, v16

    invoke-virtual {v6, v15, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 528
    const-string v15, "lastmod"

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->mSystemFacade:Lcom/zuimeia/sdk/download/providers/downloads/SystemFacade;

    move-object/from16 v16, v0

    .line 529
    invoke-interface/range {v16 .. v16}, Lcom/zuimeia/sdk/download/providers/downloads/SystemFacade;->currentTimeMillis()J

    move-result-wide v16

    invoke-static/range {v16 .. v17}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v16

    .line 528
    move-object/from16 v0, v16

    invoke-virtual {v6, v15, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    .line 531
    const-string v15, "notificationpackage"

    move-object/from16 v0, p2

    invoke-virtual {v0, v15}, Landroid/content/ContentValues;->getAsString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    .line 532
    .local v10, "pckg":Ljava/lang/String;
    const-string v15, "notificationclass"

    move-object/from16 v0, p2

    invoke-virtual {v0, v15}, Landroid/content/ContentValues;->getAsString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 533
    .local v2, "clazz":Ljava/lang/String;
    if-eqz v10, :cond_18b

    if-nez v2, :cond_16f

    if-eqz v8, :cond_18b

    .line 534
    :cond_16f
    invoke-static {}, Landroid/os/Binder;->getCallingUid()I

    move-result v11

    .line 536
    .local v11, "uid":I
    if-eqz v11, :cond_17f

    :try_start_175
    move-object/from16 v0, p0

    iget-object v15, v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->mSystemFacade:Lcom/zuimeia/sdk/download/providers/downloads/SystemFacade;

    invoke-interface {v15, v11, v10}, Lcom/zuimeia/sdk/download/providers/downloads/SystemFacade;->userOwnsPackage(ILjava/lang/String;)Z

    move-result v15

    if-eqz v15, :cond_18b

    .line 537
    :cond_17f
    const-string v15, "notificationpackage"

    invoke-virtual {v6, v15, v10}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 539
    if-eqz v2, :cond_18b

    .line 540
    const-string v15, "notificationclass"

    invoke-virtual {v6, v15, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_18b
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_175 .. :try_end_18b} :catch_2b1

    .line 548
    .end local v11    # "uid":I
    :cond_18b
    :goto_18b
    const-string v15, "country_name"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 549
    const-string v15, "notificationextras"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 550
    const-string v15, "cookiedata"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 551
    const-string v15, "useragent"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 552
    const-string v15, "referer"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 553
    invoke-virtual/range {p0 .. p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v15

    .line 554
    invoke-virtual/range {p0 .. p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v16

    invoke-static/range {v16 .. v16}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getPremissionAccessAdvanced(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v16

    .line 553
    invoke-virtual/range {v15 .. v16}, Landroid/content/Context;->checkCallingPermission(Ljava/lang/String;)I

    move-result v15

    if-nez v15, :cond_1c7

    .line 555
    const-string v15, "otheruid"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyInteger(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 557
    :cond_1c7
    const-string v15, "uid"

    invoke-static {}, Landroid/os/Binder;->getCallingUid()I

    move-result v16

    invoke-static/range {v16 .. v16}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v16

    move-object/from16 v0, v16

    invoke-virtual {v6, v15, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 558
    invoke-static {}, Landroid/os/Binder;->getCallingUid()I

    move-result v15

    if-nez v15, :cond_1e3

    .line 559
    const-string v15, "uid"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyInteger(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 561
    :cond_1e3
    const-string v15, "title"

    const-string v16, ""

    move-object/from16 v0, p2

    move-object/from16 v1, v16

    invoke-static {v15, v0, v6, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyStringWithDefault(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;Ljava/lang/String;)V

    .line 563
    const-string v15, "description"

    const-string v16, ""

    move-object/from16 v0, p2

    move-object/from16 v1, v16

    invoke-static {v15, v0, v6, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyStringWithDefault(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;Ljava/lang/String;)V

    .line 565
    const-string v15, "total_bytes"

    const/16 v16, -0x1

    invoke-static/range {v16 .. v16}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v16

    move-object/from16 v0, v16

    invoke-virtual {v6, v15, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 566
    const-string v15, "current_bytes"

    const/16 v16, 0x0

    invoke-static/range {v16 .. v16}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v16

    move-object/from16 v0, v16

    invoke-virtual {v6, v15, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 568
    const-string v15, "is_visible_in_downloads_ui"

    move-object/from16 v0, p2

    invoke-virtual {v0, v15}, Landroid/content/ContentValues;->containsKey(Ljava/lang/String;)Z

    move-result v15

    if-eqz v15, :cond_273

    .line 569
    const-string v15, "is_visible_in_downloads_ui"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyBoolean(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 578
    :goto_224
    if-eqz v8, :cond_234

    .line 579
    const-string v15, "allowed_network_types"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyInteger(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 581
    const-string v15, "allow_roaming"

    move-object/from16 v0, p2

    invoke-static {v15, v0, v6}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyBoolean(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 595
    :cond_234
    invoke-virtual/range {p0 .. p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v3

    .line 596
    .local v3, "context":Landroid/content/Context;
    new-instance v15, Landroid/content/Intent;

    const-class v16, Lcom/zuimeia/sdk/download/providers/downloads/DownloadService;

    move-object/from16 v0, v16

    invoke-direct {v15, v3, v0}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    invoke-virtual {v3, v15}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 598
    const-string v15, "downloads"

    const/16 v16, 0x0

    move-object/from16 v0, v16

    invoke-virtual {v4, v15, v0, v6}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    move-result-wide v12

    .line 599
    .local v12, "rowID":J
    const-wide/16 v16, -0x1

    cmp-long v15, v12, v16

    if-nez v15, :cond_28a

    .line 600
    const-string v15, "DownloadManager"

    const-string v16, "couldn\'t insert into downloads database"

    invoke-static/range {v15 .. v16}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 601
    const/4 v15, 0x0

    .line 607
    :goto_25c
    return-object v15

    .line 520
    .end local v2    # "clazz":Ljava/lang/String;
    .end local v3    # "context":Landroid/content/Context;
    .end local v10    # "pckg":Ljava/lang/String;
    .end local v12    # "rowID":J
    :cond_25d
    const-string v15, "visibility"

    const/16 v16, 0x2

    .line 521
    invoke-static/range {v16 .. v16}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v16

    .line 520
    move-object/from16 v0, v16

    invoke-virtual {v6, v15, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    goto/16 :goto_130

    .line 524
    :cond_26c
    const-string v15, "visibility"

    invoke-virtual {v6, v15, v14}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    goto/16 :goto_130

    .line 573
    .restart local v2    # "clazz":Ljava/lang/String;
    .restart local v10    # "pckg":Ljava/lang/String;
    :cond_273
    if-eqz v5, :cond_27b

    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v15

    if-nez v15, :cond_288

    :cond_27b
    const/4 v7, 0x1

    .line 574
    .local v7, "isExternal":Z
    :goto_27c
    const-string v15, "is_visible_in_downloads_ui"

    .line 575
    invoke-static {v7}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v16

    .line 574
    move-object/from16 v0, v16

    invoke-virtual {v6, v15, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Boolean;)V

    goto :goto_224

    .line 573
    .end local v7    # "isExternal":Z
    :cond_288
    const/4 v7, 0x0

    goto :goto_27c

    .line 604
    .restart local v3    # "context":Landroid/content/Context;
    .restart local v12    # "rowID":J
    :cond_28a
    move-object/from16 v0, p0

    move-object/from16 v1, p2

    invoke-direct {v0, v4, v12, v13, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->insertRequestHeaders(Landroid/database/sqlite/SQLiteDatabase;JLandroid/content/ContentValues;)V

    .line 605
    new-instance v15, Landroid/content/Intent;

    const-class v16, Lcom/zuimeia/sdk/download/providers/downloads/DownloadService;

    move-object/from16 v0, v16

    invoke-direct {v15, v3, v0}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    invoke-virtual {v3, v15}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 606
    move-object/from16 v0, p0

    move-object/from16 v1, p1

    invoke-direct {v0, v1, v9}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->notifyContentChanged(Landroid/net/Uri;I)V

    .line 607
    invoke-virtual/range {p0 .. p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v15

    invoke-static {v15}, Lcom/zuimeia/sdk/download/providers/downloads/Downloads;->getContentURI(Landroid/content/Context;)Landroid/net/Uri;

    move-result-object v15

    invoke-static {v15, v12, v13}, Landroid/content/ContentUris;->withAppendedId(Landroid/net/Uri;J)Landroid/net/Uri;

    move-result-object v15

    goto :goto_25c

    .line 544
    .end local v3    # "context":Landroid/content/Context;
    .end local v12    # "rowID":J
    .restart local v11    # "uid":I
    :catch_2b1
    move-exception v15

    goto/16 :goto_18b
.end method

.method public onCreate()Z
    .registers 3

    .prologue
    .line 430
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->initBaseURIs(Landroid/content/Context;)V

    .line 431
    iget-object v0, p0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->mSystemFacade:Lcom/zuimeia/sdk/download/providers/downloads/SystemFacade;

    if-nez v0, :cond_16

    .line 432
    new-instance v0, Lcom/zuimeia/sdk/download/providers/downloads/RealSystemFacade;

    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/RealSystemFacade;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->mSystemFacade:Lcom/zuimeia/sdk/download/providers/downloads/SystemFacade;

    .line 435
    :cond_16
    new-instance v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$DatabaseHelper;

    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$DatabaseHelper;-><init>(Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;Landroid/content/Context;)V

    iput-object v0, p0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->mOpenHelper:Landroid/database/sqlite/SQLiteOpenHelper;

    .line 436
    const/4 v0, 0x1

    return v0
.end method

.method public openFile(Landroid/net/Uri;Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;
    .registers 14
    .param p1, "uri"    # Landroid/net/Uri;
    .param p2, "mode"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/FileNotFoundException;
        }
    .end annotation

    .prologue
    const/4 v10, 0x1

    const/4 v3, 0x0

    const/4 v6, 0x0

    .line 1074
    new-array v2, v10, [Ljava/lang/String;

    const-string v0, "_data"

    aput-object v0, v2, v6

    move-object v0, p0

    move-object v1, p1

    move-object v4, v3

    move-object v5, v3

    invoke-virtual/range {v0 .. v5}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v7

    .line 1077
    .local v7, "cursor":Landroid/database/Cursor;
    if-eqz v7, :cond_17

    :try_start_13
    invoke-interface {v7}, Landroid/database/Cursor;->getCount()I

    move-result v6

    .line 1078
    .local v6, "count":I
    :cond_17
    if-eq v6, v10, :cond_54

    .line 1081
    if-nez v6, :cond_3b

    .line 1082
    new-instance v0, Ljava/io/FileNotFoundException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "No entry for "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V

    throw v0
    :try_end_34
    .catchall {:try_start_13 .. :try_end_34} :catchall_34

    .line 1090
    .end local v6    # "count":I
    :catchall_34
    move-exception v0

    if-eqz v7, :cond_3a

    .line 1091
    invoke-interface {v7}, Landroid/database/Cursor;->close()V

    :cond_3a
    throw v0

    .line 1084
    .restart local v6    # "count":I
    :cond_3b
    :try_start_3b
    new-instance v0, Ljava/io/FileNotFoundException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Multiple items at "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 1087
    :cond_54
    invoke-interface {v7}, Landroid/database/Cursor;->moveToFirst()Z

    .line 1088
    const/4 v0, 0x0

    invoke-interface {v7, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
    :try_end_5b
    .catchall {:try_start_3b .. :try_end_5b} :catchall_34

    move-result-object v8

    .line 1090
    .local v8, "path":Ljava/lang/String;
    if-eqz v7, :cond_61

    .line 1091
    invoke-interface {v7}, Landroid/database/Cursor;->close()V

    .line 1095
    :cond_61
    if-nez v8, :cond_6b

    .line 1096
    new-instance v0, Ljava/io/FileNotFoundException;

    const-string v1, "No filename found."

    invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 1098
    :cond_6b
    invoke-static {v8}, Lcom/zuimeia/sdk/download/providers/downloads/Helpers;->isFilenameValid(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_79

    .line 1099
    new-instance v0, Ljava/io/FileNotFoundException;

    const-string v1, "Invalid filename."

    invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 1101
    :cond_79
    const-string v0, "r"

    invoke-virtual {v0, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_a4

    .line 1102
    new-instance v0, Ljava/io/FileNotFoundException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Bad mode for "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ": "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 1105
    :cond_a4
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, v8}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    const/high16 v1, 0x10000000

    invoke-static {v0, v1}, Landroid/os/ParcelFileDescriptor;->open(Ljava/io/File;I)Landroid/os/ParcelFileDescriptor;

    move-result-object v9

    .line 1108
    .local v9, "ret":Landroid/os/ParcelFileDescriptor;
    if-nez v9, :cond_b9

    .line 1112
    new-instance v0, Ljava/io/FileNotFoundException;

    const-string v1, "couldn\'t open file"

    invoke-direct {v0, v1}, Ljava/io/FileNotFoundException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 1114
    :cond_b9
    return-object v9
.end method

.method public query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
    .registers 20
    .param p1, "uri"    # Landroid/net/Uri;
    .param p2, "projection"    # [Ljava/lang/String;
    .param p3, "selection"    # Ljava/lang/String;
    .param p4, "selectionArgs"    # [Ljava/lang/String;
    .param p5, "sort"    # Ljava/lang/String;

    .prologue
    .line 745
    sget-object v3, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sAppReadableColumnsSet:Ljava/util/HashSet;

    move-object/from16 v0, p3

    invoke-static {v0, v3}, Lcom/zuimeia/sdk/download/providers/downloads/Helpers;->validateSelection(Ljava/lang/String;Ljava/util/Set;)V

    .line 747
    iget-object v3, p0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->mOpenHelper:Landroid/database/sqlite/SQLiteOpenHelper;

    invoke-virtual {v3}, Landroid/database/sqlite/SQLiteOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v2

    .line 749
    .local v2, "db":Landroid/database/sqlite/SQLiteDatabase;
    sget-object v3, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    invoke-virtual {v3, p1}, Landroid/content/UriMatcher;->match(Landroid/net/Uri;)I

    move-result v11

    .line 750
    .local v11, "match":I
    const/4 v3, -0x1

    if-ne v11, v3, :cond_2f

    .line 754
    new-instance v3, Ljava/lang/IllegalArgumentException;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Unknown URI: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v3

    .line 757
    :cond_2f
    const/4 v3, 0x5

    if-ne v11, v3, :cond_45

    .line 758
    if-nez p2, :cond_38

    if-nez p3, :cond_38

    if-eqz p5, :cond_40

    .line 759
    :cond_38
    new-instance v3, Ljava/lang/UnsupportedOperationException;

    const-string v4, "Request header queries do not support projections, selections or sorting"

    invoke-direct {v3, v4}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v3

    .line 763
    :cond_40
    invoke-direct {p0, v2, p1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->queryRequestHeaders(Landroid/database/sqlite/SQLiteDatabase;Landroid/net/Uri;)Landroid/database/Cursor;

    move-result-object v12

    .line 792
    :cond_44
    :goto_44
    return-object v12

    .line 766
    :cond_45
    move-object/from16 v0, p3

    move-object/from16 v1, p4

    invoke-direct {p0, p1, v0, v1, v11}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getWhereClause(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;I)Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;

    move-result-object v10

    .line 773
    .local v10, "fullSelection":Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;
    const-string v3, "downloads"

    .line 774
    invoke-virtual {v10}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;->getSelection()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v10}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;->getParameters()[Ljava/lang/String;

    move-result-object v6

    const/4 v7, 0x0

    const/4 v8, 0x0

    move-object/from16 v4, p2

    move-object/from16 v9, p5

    .line 773
    invoke-virtual/range {v2 .. v9}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v12

    .line 777
    .local v12, "ret":Landroid/database/Cursor;
    if-eqz v12, :cond_69

    .line 778
    new-instance v13, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$ReadOnlyCursorWrapper;

    invoke-direct {v13, p0, v12}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$ReadOnlyCursorWrapper;-><init>(Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;Landroid/database/Cursor;)V

    .end local v12    # "ret":Landroid/database/Cursor;
    .local v13, "ret":Landroid/database/Cursor;
    move-object v12, v13

    .line 781
    .end local v13    # "ret":Landroid/database/Cursor;
    .restart local v12    # "ret":Landroid/database/Cursor;
    :cond_69
    if-eqz v12, :cond_44

    .line 782
    invoke-virtual {p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    invoke-interface {v12, v3, p1}, Landroid/database/Cursor;->setNotificationUri(Landroid/content/ContentResolver;Landroid/net/Uri;)V

    goto :goto_44
.end method

.method public update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I
    .registers 29
    .param p1, "uri"    # Landroid/net/Uri;
    .param p2, "values"    # Landroid/content/ContentValues;
    .param p3, "where"    # Ljava/lang/String;
    .param p4, "whereArgs"    # [Ljava/lang/String;

    .prologue
    .line 912
    sget-object v5, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sAppReadableColumnsSet:Ljava/util/HashSet;

    move-object/from16 v0, p3

    invoke-static {v0, v5}, Lcom/zuimeia/sdk/download/providers/downloads/Helpers;->validateSelection(Ljava/lang/String;Ljava/util/Set;)V

    .line 914
    move-object/from16 v0, p0

    iget-object v5, v0, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->mOpenHelper:Landroid/database/sqlite/SQLiteOpenHelper;

    invoke-virtual {v5}, Landroid/database/sqlite/SQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v14

    .line 917
    .local v14, "db":Landroid/database/sqlite/SQLiteDatabase;
    const/16 v22, 0x0

    .line 919
    .local v22, "startService":Z
    const-string v5, "deleted"

    move-object/from16 v0, p2

    invoke-virtual {v0, v5}, Landroid/content/ContentValues;->containsKey(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_2c

    .line 920
    const-string v5, "deleted"

    move-object/from16 v0, p2

    invoke-virtual {v0, v5}, Landroid/content/ContentValues;->getAsInteger(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v5

    const/4 v6, 0x1

    if-ne v5, v6, :cond_2c

    .line 922
    const/16 v22, 0x1

    .line 927
    :cond_2c
    invoke-static {}, Landroid/os/Binder;->getCallingPid()I

    move-result v5

    invoke-static {}, Landroid/os/Process;->myPid()I

    move-result v6

    if-eq v5, v6, :cond_c6

    .line 928
    new-instance v16, Landroid/content/ContentValues;

    invoke-direct/range {v16 .. v16}, Landroid/content/ContentValues;-><init>()V

    .line 929
    .local v16, "filteredValues":Landroid/content/ContentValues;
    const-string v5, "entity"

    move-object/from16 v0, p2

    move-object/from16 v1, v16

    invoke-static {v5, v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 930
    const-string v5, "visibility"

    move-object/from16 v0, p2

    move-object/from16 v1, v16

    invoke-static {v5, v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyInteger(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 931
    const-string v5, "control"

    move-object/from16 v0, p2

    invoke-virtual {v0, v5}, Landroid/content/ContentValues;->getAsInteger(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v17

    .line 932
    .local v17, "i":Ljava/lang/Integer;
    if-eqz v17, :cond_62

    .line 933
    const-string v5, "control"

    move-object/from16 v0, v16

    move-object/from16 v1, v17

    invoke-virtual {v0, v5, v1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 934
    const/16 v22, 0x1

    .line 937
    :cond_62
    const-string v5, "control"

    move-object/from16 v0, p2

    move-object/from16 v1, v16

    invoke-static {v5, v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyInteger(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 938
    const-string v5, "title"

    move-object/from16 v0, p2

    move-object/from16 v1, v16

    invoke-static {v5, v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 939
    const-string v5, "description"

    move-object/from16 v0, p2

    move-object/from16 v1, v16

    invoke-static {v5, v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyString(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 940
    const-string v5, "deleted"

    move-object/from16 v0, p2

    move-object/from16 v1, v16

    invoke-static {v5, v0, v1}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->copyInteger(Ljava/lang/String;Landroid/content/ContentValues;Landroid/content/ContentValues;)V

    .line 964
    .end local v17    # "i":Ljava/lang/Integer;
    :cond_86
    :goto_86
    sget-object v5, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->sURIMatcher:Landroid/content/UriMatcher;

    move-object/from16 v0, p1

    invoke-virtual {v5, v0}, Landroid/content/UriMatcher;->match(Landroid/net/Uri;)I

    move-result v20

    .line 965
    .local v20, "match":I
    packed-switch v20, :pswitch_data_170

    .line 981
    const-string v5, "DownloadManager"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "updating unknown/invalid URI: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    move-object/from16 v0, p1

    invoke-virtual {v6, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 982
    new-instance v5, Ljava/lang/UnsupportedOperationException;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "Cannot update URI: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    move-object/from16 v0, p1

    invoke-virtual {v6, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 942
    .end local v16    # "filteredValues":Landroid/content/ContentValues;
    .end local v20    # "match":I
    :cond_c6
    move-object/from16 v16, p2

    .line 943
    .restart local v16    # "filteredValues":Landroid/content/ContentValues;
    const-string v5, "_data"

    move-object/from16 v0, p2

    invoke-virtual {v0, v5}, Landroid/content/ContentValues;->getAsString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v15

    .line 944
    .local v15, "filename":Ljava/lang/String;
    if-eqz v15, :cond_109

    .line 945
    const/4 v5, 0x1

    new-array v7, v5, [Ljava/lang/String;

    const/4 v5, 0x0

    const-string v6, "title"

    aput-object v6, v7, v5

    const/4 v8, 0x0

    const/4 v9, 0x0

    const/4 v10, 0x0

    move-object/from16 v5, p0

    move-object/from16 v6, p1

    invoke-virtual/range {v5 .. v10}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v11

    .line 947
    .local v11, "c":Landroid/database/Cursor;
    invoke-interface {v11}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v5

    if-eqz v5, :cond_f6

    const/4 v5, 0x0

    invoke-interface {v11, v5}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/String;->length()I

    move-result v5

    if-nez v5, :cond_106

    .line 948
    :cond_f6
    const-string v5, "title"

    new-instance v6, Ljava/io/File;

    invoke-direct {v6, v15}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 949
    invoke-virtual {v6}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v6

    .line 948
    move-object/from16 v0, p2

    invoke-virtual {v0, v5, v6}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 951
    :cond_106
    invoke-interface {v11}, Landroid/database/Cursor;->close()V

    .line 954
    .end local v11    # "c":Landroid/database/Cursor;
    :cond_109
    const-string v5, "status"

    move-object/from16 v0, p2

    invoke-virtual {v0, v5}, Landroid/content/ContentValues;->getAsInteger(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v23

    .line 955
    .local v23, "status":Ljava/lang/Integer;
    if-eqz v23, :cond_12d

    .line 956
    invoke-virtual/range {v23 .. v23}, Ljava/lang/Integer;->intValue()I

    move-result v5

    const/16 v6, 0xbe

    if-ne v5, v6, :cond_12d

    const/16 v18, 0x1

    .line 957
    .local v18, "isRestart":Z
    :goto_11d
    const-string v5, "bypass_recommended_size_limit"

    .line 958
    move-object/from16 v0, p2

    invoke-virtual {v0, v5}, Landroid/content/ContentValues;->containsKey(Ljava/lang/String;)Z

    move-result v19

    .line 959
    .local v19, "isUserBypassingSizeLimit":Z
    if-nez v18, :cond_129

    if-eqz v19, :cond_86

    .line 960
    :cond_129
    const/16 v22, 0x1

    goto/16 :goto_86

    .line 956
    .end local v18    # "isRestart":Z
    .end local v19    # "isUserBypassingSizeLimit":Z
    :cond_12d
    const/16 v18, 0x0

    goto :goto_11d

    .line 970
    .end local v15    # "filename":Ljava/lang/String;
    .end local v23    # "status":Ljava/lang/Integer;
    .restart local v20    # "match":I
    :pswitch_130
    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move-object/from16 v2, p3

    move-object/from16 v3, p4

    move/from16 v4, v20

    invoke-direct {v0, v1, v2, v3, v4}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getWhereClause(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;I)Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;

    move-result-object v21

    .line 972
    .local v21, "selection":Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;
    invoke-virtual/range {v16 .. v16}, Landroid/content/ContentValues;->size()I

    move-result v5

    if-lez v5, :cond_16e

    .line 973
    const-string v5, "downloads"

    .line 974
    invoke-virtual/range {v21 .. v21}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;->getSelection()Ljava/lang/String;

    move-result-object v6

    invoke-virtual/range {v21 .. v21}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider$SqlSelection;->getParameters()[Ljava/lang/String;

    move-result-object v7

    .line 973
    move-object/from16 v0, v16

    invoke-virtual {v14, v5, v0, v6, v7}, Landroid/database/sqlite/SQLiteDatabase;->update(Ljava/lang/String;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    move-result v13

    .line 985
    .local v13, "count":I
    :goto_154
    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move/from16 v2, v20

    invoke-direct {v0, v1, v2}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->notifyContentChanged(Landroid/net/Uri;I)V

    .line 986
    if-eqz v22, :cond_16d

    .line 987
    invoke-virtual/range {p0 .. p0}, Lcom/zuimeia/sdk/download/providers/downloads/DownloadProvider;->getContext()Landroid/content/Context;

    move-result-object v12

    .line 988
    .local v12, "context":Landroid/content/Context;
    new-instance v5, Landroid/content/Intent;

    const-class v6, Lcom/zuimeia/sdk/download/providers/downloads/DownloadService;

    invoke-direct {v5, v12, v6}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    invoke-virtual {v12, v5}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 990
    .end local v12    # "context":Landroid/content/Context;
    :cond_16d
    return v13

    .line 976
    .end local v13    # "count":I
    :cond_16e
    const/4 v13, 0x0

    .line 978
    .restart local v13    # "count":I
    goto :goto_154

    .line 965
    :pswitch_data_170
    .packed-switch 0x1
        :pswitch_130
        :pswitch_130
        :pswitch_130
        :pswitch_130
    .end packed-switch
.end method
